<template>
  <div class="statistics">
    <img :src="moneyIcon">
    <span class="statistics-title">{{ title }}:</span>
    <el-tooltip
      v-if="totalTaxAmount || totalTaxAmount === 0"
      :content="(totalTaxAmount / 100).toString()"
      placement="top">
      <span class="statistics-value">{{ ( totalTaxAmount / 100) | bigNumberZH }}</span>
    </el-tooltip>
    <span v-else class="statistics-value">--</span>
  </div>
</template>

<script>
import moneyIcon from '@/assets/dataDisplay/icon_28.png';
import { bigNumberZH } from '@/filters/number';
export default {
  name: 'TopRightAmount',
  filters: {
    bigNumberZH
  },
  props: {
    title: {
      type: String,
      default: ''
    },
    totalTaxAmount: {
      type: Number || String,
      default: null
    }
  },
  data() {
    return {
      moneyIcon
    };
  }
};
</script>

<style scoped lang="scss">
.statistics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background-color: #fafafc;
  height: 32px;
  padding: 0 10px;
  margin-right: 6px;
  img  {
    width: 16px;
    height: 16px;
    margin-right: 4px;
  }
  .statistics-title {
    font-size: 14px;
    color: #999;
    font-weight: 500;
    line-height: 14px;
    margin-right: 5px;
  }
  .statistics-value {
    font-size: 16px;
    font-weight: bold;
    line-height: 20px;
    color: #5F77C3;
  }
}
</style>
